Learn R Programming

Seurat (version 3.0.1)

[.Seurat: Subset a Seurat object

Description

Subset a Seurat object

Usage

# S3 method for Seurat
[(x, i, j, ...)

# S3 method for Seurat subset(x, subset, cells = NULL, features = NULL, idents = NULL, ...)

Arguments

x

Seurat object to be subsetted

i, features

A vector of features to keep

j, cells

A vector of cells to keep

...

Extra parameters passed to WhichCells, such as slot, invert, or downsample

subset

Logical expression indicating features/variables to keep

idents

A vector of identity classes to keep

Value

A subsetted Seurat object

See Also

subset WhichCells

Examples

Run this code
# NOT RUN {
pbmc_small[VariableFeatures(object = pbmc_small), ]
pbmc_small[, 1:10]

subset(x = pbmc_small, subset = MS4A1 > 4)
subset(x = pbmc_small, subset = `DLGAP1-AS1` > 2)
subset(x = pbmc_small, idents = '0', invert = TRUE)
subset(x = pbmc_small, subset = MS4A1 > 3, slot = 'counts')
subset(x = pbmc_small, features = VariableFeatures(object = pbmc_small))

# }

Run the code above in your browser using DataLab